<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title>controllers/lesson_material_controller_spec.rb</title>
    <link href="screen.css" media="all" rel="stylesheet" type="text/css" />
    <link href="print.css" media="print" rel="stylesheet" type="text/css" />
    
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
    <script type="text/javascript" src="rcov.js"></script>
  </head>
  <body>
    <h1>Spec C0 Coverage Information - RCov</h1>
    <h2>controllers/lesson_material_controller_spec.rb</h2>

    

    <div class="report_table_wrapper">
      <table class='report' id='report_table'>
        <thead>
          <tr>
            <th class="left_align">Name</th>
            <th class="right_align">Total Lines</th>
            <th class="right_align">Lines of Code</th>
            <th class="left_align">Total Coverage</th>
            <th class="left_align">Code Coverage</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="left_align"><a href="controllers-lesson_material_controller_spec_rb.html">controllers/lesson_material_controller_spec.rb</a></td>
            <td class='right_align'><tt>45</tt></td>
            <td class='right_align'><tt>36</tt></td>
            <td class="left_align"><div class="percent_graph_legend"><tt class=''>2.22%</tt></div>
          <div class="percent_graph">
            <div class="covered" style="width:2px"></div>
            <div class="uncovered" style="width:98px"></div>
          </div></td>
            <td class="left_align"><div class="percent_graph_legend"><tt class=''>0.00%</tt></div>
          <div class="percent_graph">
            <div class="covered" style="width:0px"></div>
            <div class="uncovered" style="width:100px"></div>
          </div></td>
          </tr>
        </tbody>
      </table>
    </div>
    
    <h3>Key</h3>
    
    <div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>

    <h3>Coverage Details</h3>

    <table class="details">
      <tbody>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line1">1</a> require 'spec_helper'</pre></td>
          </tr>
        
          
          
          <tr class="marked">
            <td><pre><a name="line2">2</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line3">3</a> describe LessonMaterialController do</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line4">4</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line5">5</a>     before :each do</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line6">6</a>         @mock_file = mock(File)</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line7">7</a>         @mock_file.stub!(:original_filename).and_return('blah.txt', 'a.txt', 'b.txt')</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line8">8</a>         @mock_file.stub!(:read).and_return(65, 10, 20)</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line9">9</a>     end</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line10">10</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line11">11</a>     after :each do</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line12">12</a>         begin</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line13">13</a>           File.delete('public/data/blah.txt')</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line14">14</a>           File.delete('public/data/a.txt')</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line15">15</a>           File.delete('public/data/b.txt')</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line16">16</a>         rescue</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line17">17</a>         end</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line18">18</a>     end    </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line19">19</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line20">20</a>     it 'should flash an error message when there is no file to upload' do</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line21">21</a>         post 'uploadFile', {:title =&gt; 'Teste'}</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line22">22</a>         flash[:notice].should eql('Choose a file to upload')</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line23">23</a>     end</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line24">24</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line25">25</a>     it 'should flash an error message when there is no title to the upload' do</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line26">26</a>         post 'uploadFile', {:title =&gt; '', :upload =&gt; @mock_file}</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line27">27</a>         flash[:notice].should eql('Choose a title to your upload')</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line28">28</a>     end</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line29">29</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line30">30</a>     it 'should save a file correctly and display a message' do</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line31">31</a>         post 'uploadFile', {:title =&gt; 'Teste', :upload =&gt; @mock_file}</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line32">32</a>         flash[:notice].should eql('Lesson added')</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line33">33</a>         File.open('public/data/blah.txt', &quot;rb&quot;) { |f| f.read.should eql(&quot;65&quot;) }</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line34">34</a>     end</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line35">35</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line36">36</a>     it 'should find all the files uploaded' do</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line37">37</a>         post 'uploadFile', {:title =&gt; 'arquivo 1', :upload =&gt; @mock_file}</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line38">38</a>         post 'uploadFile', {:title =&gt; 'arquivo 2', :upload =&gt; @mock_file}</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line39">39</a>         post 'uploadFile', {:title =&gt; 'arquivo 3', :upload =&gt; @mock_file}</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line40">40</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line41">41</a>         @files = LessonMaterial.find :all</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line42">42</a>         @files.size.should eql(3)</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line43">43</a>     end</pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line44">44</a> </pre></td>
          </tr>
        
          
          
          <tr class="uncovered">
            <td><pre><a name="line45">45</a> end</pre></td>
          </tr>
        
      </tbody>
    </table>

    <p>Generated on 2011-06-27 13:48:40 -0300 with <a href="http://github.com/relevance/rcov">rcov 0.9.8</a></p>

  </body>
</html>
